Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MOB-9258] fixed nested IsSet matching #427

Merged
merged 4 commits into from
Aug 12, 2024

Conversation

darshan-iterable
Copy link

@darshan-iterable darshan-iterable commented Aug 7, 2024

JIRA Ticket(s) if any

Description

[Web SDK] nested object isSet does not match

Test Steps

Video attached to the ticket, See a JIRA ticket for the video

return Object.keys(valueFromObj).map((key) =>
this.getValueFromNestedObject(valueFromObj, key)
);
if (typeof valueFromObj === 'object' && valueFromObj !== null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add additional test coverage for this method?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While reviewing the scenario for writing the test case, I realised that this scenario will never occur because our portal doesn't accept values as objects when creating criteria. Therefore, I have removed that method, and everything is working fine for all the criteria.

} else {
return valueFromObj;
}
}

private getFieldValue(data: any, field: string): any {
const fields = field.split('.');
return fields.reduce((acc, field) => acc?.[field], data);
return fields.reduce((value, currentField) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here as above

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have already written test case for this. You can verify that in Line no: 672 of file 'src/anonymousUserTracking/complexCriteria.test.ts' -- it('should return criteriaId 100 (complex criteria 3)'

@mprew97 mprew97 merged commit 5d60f23 into AUT_main Aug 12, 2024
1 check passed
@mprew97 mprew97 deleted the bugfix/MOB-9258-fixed-nested-isSet-matching branch August 12, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants